package distributed.lock.redis;

import java.util.concurrent.TimeUnit;


/**
 * Jedis 是配置器
 */

public class JedisRedisHandleAdapter implements RedisHandleAdapter {
    @Override
    public boolean supports(Object handler) {
        return (handler instanceof RedisHandle);
    }

    @Override
    public boolean setnx(String key, String value, long time, TimeUnit timeUnit, Object handler) {
        return ((RedisHandle) handler).setnx(key, value, time, timeUnit);
    }

    @Override
    public boolean comparAndDel(String key, String value, Object handler) {
        return ((RedisHandle) handler).comparAndDel(key, value);
    }
}
